package com.zt.ftphelper.model;

import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

/**
 * @author zt
 * @Description: tableView展示用
 * @date 14/08/2019 11:46
 */
public class FileItem {
    private final StringProperty path = new SimpleStringProperty();
    private final ObjectProperty name = new SimpleObjectProperty<NameObject>();
    private final StringProperty type = new SimpleStringProperty();//有点多余，先不删了
    private final StringProperty size = new SimpleStringProperty();

    public FileItem() {
        setPath("");
        setName(new NameObject("","..","d"));
        setType("d");
        setSize(null);
    }

    public FileItem(String path,String name, String type, String size) {
        setPath(path);
        setName(new NameObject(path,name,type));
        setType(type);
        setSize(size);
    }

    public Object getName() {
        return name.get();
    }

    public ObjectProperty nameProperty() {
        return name;
    }

    public void setName(Object name) {
        this.name.set(name);
    }

    public String getPath() {
        return path.get();
    }

    public StringProperty pathProperty() {
        return path;
    }

    public void setPath(String path) {
        this.path.set(path);
    }

    public String getType() {
        return type.get();
    }

    public StringProperty typeProperty() {
        return type;
    }

    public void setType(String type) {
        this.type.set(type);
    }

    public String getSize() {
        return size.get();
    }

    public StringProperty sizeProperty() {
        return size;
    }

    public void setSize(String size) {
        this.size.set(size);
    }

    @Override
    public String toString() {
        return getPath();
    }
}
